#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

bool overlap(vector<int> m1, vector<int> m2){
    return min(m1[1], m2[1]) > max(m1[0], m2[0]);
}

int main(){

    vector<vector<int>> twoD = {{0, 30}, {5, 10}, {1, 20}};
    cout<<"twoD array size: " << twoD.size() << endl;
    cout<<"twoD first element size: " << twoD[0].size() << endl;

    // for(int i = 0; i < twoD.size(); i++)
    //     for(int j = i + 1; j < twoD.size(); j++){
    //         cout<<twoD[i][0] << ", " << twoD[i][1] << endl;
    //         if(overlap(twoD[i], twoD[j])) {
    //             cout << "false" << endl;
    //             return 0;
    //         }
    //     }
    // cout << "true" << endl;

    for (auto it : twoD){
        for(auto it2 : it){
            cout<<it2<<" ";
        }
        cout<<endl;
    }
    
    sort(twoD.begin(), twoD.end());

    for (auto it : twoD){
        for(auto it2 : it){
            cout<<it2<<" ";
        }
        cout<<endl;
    }

    return 0;
}

